package com.homegoods.home.model;

import com.homegoods.home.item.SearchProductItem;
import com.homegoods.resource.HomeGoodsApp;
import com.kedll.library.adapter.MultiTypeAdapter;
import com.kedll.library.mvp.BaseModel;

public class SearchProductListModel extends BaseModel<SearchProductItem> {

    /**
     * id : 26                                                      //
     * productSn : 6e29d0c1-925c-4de0-96c7-65b8b093df78             //
     * brandId : 40                                                 //品牌id
     * brandName : null                                             //品牌名
     * point : 100                                                  //积分
     * categoryId : 75                                              //类别id
     * categoryName : 牛仔裤                                        //类别名称
     * pic : mall/images/20190702/1562051296100XePGNDXY8hBnh5cDn3sTXGYQC2FRNdjW.png //商品图片
     * productName : 牛仔裤0100001                                   //商品名称
     * minPrice : 1                                                 //最低价格
     * maxPrice : 3999                                              //最高价格
     * saleNum : 0                                                  //销量
     * stock : 3310                                                 //库存
     * distributionType : true                                      //是否包邮
     * cityName : 市辖区                                             //发货地址
     */

    private int id;
    private String productSn;
    private int brandId;
    private Object brandName;
    private int point;
    private int categoryId;
    private String categoryName;
    private String pic;
    private String productName;
    private int minPrice;
    private int maxPrice;
    private int saleNum;
    private int stock;
    private boolean distributionType;
    private String cityName;

    public String getId() {
        return String.valueOf(id);
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getProductSn() {
        return productSn;
    }

    public void setProductSn(String productSn) {
        this.productSn = productSn;
    }

    public int getBrandId() {
        return brandId;
    }

    public void setBrandId(int brandId) {
        this.brandId = brandId;
    }

    public Object getBrandName() {
        return brandName;
    }

    public void setBrandName(Object brandName) {
        this.brandName = brandName;
    }

    public int getPoint() {
        return point;
    }

    public void setPoint(int point) {
        this.point = point;
    }

    public int getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(int categoryId) {
        this.categoryId = categoryId;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getPic() {
        return HomeGoodsApp.getOSSHost() + "/" +pic;
    }

    public void setPic(String pic) {
        this.pic = pic;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getMinPrice() {
        return String.valueOf(minPrice);
    }

    public void setMinPrice(int minPrice) {
        this.minPrice = minPrice;
    }

    public int getMaxPrice() {
        return maxPrice;
    }

    public void setMaxPrice(int maxPrice) {
        this.maxPrice = maxPrice;
    }

    public int getSaleNum() {
        return saleNum;
    }

    public void setSaleNum(int saleNum) {
        this.saleNum = saleNum;
    }

    public int getStock() {
        return stock;
    }

    public void setStock(int stock) {
        this.stock = stock;
    }

    public String isDistributionType() {
        return distributionType ? "包邮" : "自费邮费";
    }

    public void setDistributionType(boolean distributionType) {
        this.distributionType = distributionType;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    @Override
    public SearchProductItem createItem(MultiTypeAdapter adapter) {
        return new SearchProductItem(this);
    }
}
